public class Main2 {
    public static void main(String[] args) {
        ControlPanel controlPanel = new ControlPanel();

        // 模拟按键输入
        controlPanel.processKeyPress('1');
        controlPanel.processKeyPress('2');
        controlPanel.processKeyPress('3');
        controlPanel.processKeyPress('4');

        // 如果密码正确，状态将会变为FUNCTION_SELECTION
        System.out.println("Current state: " + controlPanel.getState());

        // 模拟错误密码输入
        controlPanel.processKeyPress('0');
        controlPanel.processKeyPress('0');
        controlPanel.processKeyPress('0');

        // 如果超过最大尝试次数，状态将会变为LOCKED
        System.out.println("Current state: " + controlPanel.getState());

        // 模拟锁定时间过去后再次尝试
        try {
            Thread.sleep(121000); // 休眠121秒（锁定时间为120秒）
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        controlPanel.processKeyPress('#');

        // 锁定时间过去后，状态将会恢复为IDLE
        System.out.println("Current state: " + controlPanel.getState());
    }
}